<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/ ' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>轮播图管理</el-breadcrumb-item>
    </el-breadcrumb>
    <el-button type="primary" size="small" @click="change">添加</el-button>
     <v-list @edit="edit"></v-list>
    <v-dialog :dialist="dialog" @cancle="cancle" ref="dialogs"></v-dialog>
  </div>
</template>
<script>
import vList from "./list";
import vDialog from "./dialog";
import vBread from "../../common/elBread";
export default {
  components: {
    vList,
    vDialog,
    vBread,
 
  },
  data() {
    return {
      dialog: {
        isShow: false,
        isAdd: true,
      },
    };
  },
  methods: {
    //添加功能
    change() {
      this.dialog.isShow = true;
      this.dialog.isAdd = true;
    },
    cancle(e) {
      this.dialog.isShow = e;
    },
    //子组件的编辑功能，由父组件dialog
    edit(e) {
      this.$refs.dialogs.lookup(e);
      this.dialog.isAdd = false;
      this.dialog.isShow = true;
    },
    
  },
};
</script>

<style scoped>
.el-button {
  margin-top: 15px;
}
</style>